<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:import url = "inc/header.jsp" />

<h1>Nahraj CSV soubor a nakrm databazi</h1>

<h2>nahravani Archivu</h2>
<form method="post" action="csvloader/archive.html" enctype="multipart/form-data">
    <input type="file" name="file"/>
    <input type="submit" />
</form><br/>

<br/>

<h2>nahravani JavaClass</h2>
<form method="post" action="csvloader/javaclass.html" enctype="multipart/form-data">
    <input type="file" name="file"/>
    <input type="submit"/>
</form><br/>

<br/>
<a href="jarinaservlet/list/archive/0.html">seznam archivu</a><br/>
<br/>


<c:if test="${archives ne null}">

    <h2>Result of loading Archives from CSV:</h2>
    <h3>tabulka archivu</h3>
    <table style="border: 1px solid black; width: 100%; font-family: Verdana;">
    <thead style="background-color: #aaaacc; color: #eeeeee; ">
        <tr>
            <td><b>Store date</b></td>
            <td><b>group id</b></td>
            <td><b>artifact id</b></td>
            <td><b>version</b></td>
        </tr>
    </thead>
    <c:forEach var="archive" items="${archives}">
        <c:if test="${archive.id mod 2 eq 1}">
            <tr style="background-color: #eeffee;">
        </c:if>
        <c:if test="${archive.id mod 2 ne 1}">
            <tr style="background-color: #bbccbb;">
        </c:if>
            <td>${archive.storeDate}</td>
            <td>${archive.groupId}</td>
            <td>${archive.artifactId}</td>
            <td>${archive.version}</td>
        </tr>
    </c:forEach>
    </table>
</c:if>

<c:import url="inc/footer.jsp" />